/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bean;

import BO.UserBO;
import java.util.Map;
import java.util.Set;
import javax.faces.application.ConfigurableNavigationHandler;
import javax.faces.context.FacesContext;
import javax.faces.event.ComponentSystemEvent;
import pojo.Permission;
import pojo.User;

/**
 *
 * @author phong
 */
public class UserBean {

    private String userID;
    private String pass;
    private User user;

    /**
     * Creates a new instance of UserBean
     */
    public UserBean() {
    }

    public String getPass() {
        return pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }

    public String getUserID() {
        return userID;
    }

    public void setUserID(String userID) {
        this.userID = userID;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    //<editor-fold defaultstate="collapsed" desc="Chuc nang dang nhap">
    public String login() {
        return UserBO.login(userID, pass);
    }
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc="Lấy thông tin User thông qua id">
    public User getUserByID(String id) {
        user = UserBO.getUserByID(id);
        return user;
    }
    //</editor-fold>    
}
